<template>
  <div class="report-form-content">
    <div>
      <el-tabs v-model="activeName" class="demo-tabs">
        <el-tab-pane label="报账信息" name="first"></el-tab-pane>
        <el-tab-pane label="费用类型" name="second"></el-tab-pane>
        <el-tab-pane label="收支信息" name="third"></el-tab-pane>
      </el-tabs>
      <div class="tabs-list" v-show="activeName === 'first'">
        <el-row :gutter="20">
          <el-col :sm="24" :lg="29" style="padding-left: 1.25rem">
            <div class="" style="display: flex;align-items: center;" v-if="expenditureApplicationObj.id">
              <h2>事前申请单用款信息</h2>
            </div>
            <el-card class="update-log" v-if="expenditureApplicationObj.id">
              <div class="report-form-list-content">
                <div class="data-item">
                  <label>申请单号</label>
                  <span>{{ expenditureApplicationObj.applicationCode }}</span>
                </div>
                <div class="data-item">
                  <label>申请日期</label>
                  <span>{{ expenditureApplicationObj.applicationDate?.substring(0, 10) }}</span>
                </div>
                <div class="data-item">
                  <label>事前领用类型</label>
                  <span><DictTag :dict-list="getDictList('ExpenditureApplicationType')" :dict-key="expenditureApplicationObj.applicationType" /></span>
                </div>
                <div class="data-item">
                  <label>申请金额</label>
                  <span>￥{{ expenditureApplicationObj.amount }}</span>
                </div>
                <div class="data-item">
                  <label>请款事由</label>
                  <span>{{ expenditureApplicationObj.items }}</span>
                </div>
                <div class="data-item">
                  <label>支出事项</label>
                  <span>{{ expenditureApplicationObj.reason }}</span>
                </div>
              </div>
              <div class="data-item data-item-1">
                <label>备注</label>
                <span>{{ expenditureApplicationObjNaNpxark }}</span>
              </div>
            </el-card>
            <div class="" style="display: flex;align-items: center;">
              <h2>指标信息</h2>
            </div>
            <el-card class="update-log">
              <div class="report-form-list-content">
                <div class="data-item data-item-1">
                  <label>指标单编码</label>
                  <span>{{ expenditureKpiObj.kpiCode }}</span>
                </div>
                <div class="data-item data-item-1">
                  <label>指标单名称</label>
                  <span>{{expenditureKpiObj.kpiName}}</span>
                </div>
                <div class="data-item">
                  <label>预算年度</label>
                  <span>{{ expenditureKpiObj.year }}</span>
                </div>
                <div class="data-item">
                  <label>支出类型</label>
                  <span><DictTag :dict-list="getDictList('ExpenditureKpiPayType')" :dict-key="expenditureKpiObj.payType" /></span>
                </div>
                <div class="data-item">
                  <label>经费类型</label>
                  <span><DictTag :dict-list="getDictList('ExpenditureKpiFundType')" :dict-key="expenditureKpiObj.fundType" /></span>
                </div>
                <div class="data-item">
                  <label>预算总金额</label>
                  <span>￥{{ expenditureKpiObj.amount }}</span>
                </div>
                <div class="data-item">
                  <label>部门</label>
                  <span>{{ showIdLabel(organizationList, expenditureKpiObj.organizationId, 'organizationName') }}</span>
                </div>
                <div class="data-item">
                  <label>功能分类</label>
                  <span>{{ showIdLabel(expenditureFunctionalList, expenditureKpiObj.expenditureFunctionalId, 'name') }}</span>
                </div>
                <div class="data-item data-item-1">
                  <label>财政项目</label>
                  <span>{{ showIdLabel(expenditureFiscalList, expenditureKpiObj.expenditureFiscalId, 'name') }}</span>
                </div>
                <div class="data-item">
                  <label>指标来源</label>
                  <span><DictTag :dict-list="getDictList('ExpenditureKpiSource')" :dict-key="expenditureKpiObj.source" /></span>
                </div>
                <div class="data-item">
                  <label>项目负责人</label>
                  <span>{{ showIdLabel(userList, expenditureKpiObj.managerId, 'name') }}</span>
                </div>
                <div class="data-item">
                  <label>项目类型</label>
                  <span>{{ showIdLabel(expenditurePtypeList, expenditureKpiObj.expenditurePtypeId, 'name') }}</span>
                </div>
              </div>
            </el-card>
            <div class="" style="display: flex;align-items: center;">
              <h2>报账单信息</h2>
            </div>
            <el-card class="update-log">
              <div class="report-form-list-content">
                <div class="data-item">
                  <label>报账单号</label>
                  <span>{{ obj.reimbursementCode }}</span>
                </div>
                <div class="data-item">
                  <label>报账日期</label>
                  <span>{{ obj.reimbursementDate?.substring(0, 10) }}</span>
                </div>
                <div class="data-item">
                  <label>经济分类</label>
                  <span>{{ showIdLabel(expenditureEconomicList, obj.expenditureEconomicId, 'name') }}</span>
                </div>
                <div class="data-item">
                  <label>会计科目</label>
                  <span>{{ showIdLabel(expenditureSubjectList, obj.expenditureSubjectId, 'name') }}</span>
                </div>
                <div class="data-item">
                  <label>金额</label>
                  <span>￥{{ obj.amount }}</span>
                </div>
                <div class="data-item">
                  <label>结算方式</label>
                  <span><DictTag :dict-list="getDictList('ExpenditureSettlement')" :dict-key="obj.settlement" /></span>
                </div>
              </div>
            </el-card>
          </el-col>
        </el-row>
      </div>
      <div class="tabs-list" v-show="activeName === 'second'">
        <el-row :gutter="20">
          <!--差旅费明细-->
          <el-col :sm="24" :lg="29" style="padding-left: 1.25rem" v-if="travels.length > 0">
            <div class="" style="display: flex;align-items: center;">
              <h2>差旅费明细</h2>
            </div>
            <el-card class="update-log bgcolorgray">
              <div class="report-form-list-content">
                <div class="data-item">
                  <label>开始时间</label>
                  <span>{{ travels[0].travelStart?.substring(0, 10) }}</span>
                </div>
                <div class="data-item">
                  <label>结束时间</label>
                  <span>{{ travels[0].travelEnd?.substring(0, 10) }}</span>
                </div>
                <div class="data-item">
                  <label>开始地点</label>
                  <span>{{ travels[0].travelPositionStart }}</span>
                </div>
                <div class="data-item">
                  <label>结束地点</label>
                  <span>{{ travels[0].travelPositionEnd }}</span>
                </div>
                <div class="data-item">
                  <label>出差人</label>
                  <span>{{ travels[0].travelPeople }}</span>
                </div>
                <div class="data-item">
                  <label>出差人数</label>
                  <span>{{ travels[0].travelNum }}</span>
                </div>
                <div class="data-item">
                  <label>职级</label>
                  <span>{{ travels[0].travelRank }}</span>
                </div>
                <div class="data-item">
                  <label>机票费</label>
                  <span>{{ travels[0].amountPlane }}</span>
                </div>
                <div class="data-item">
                  <label>动车火车费</label>
                  <span>{{ travels[0].amountTrain }}</span>
                </div>
                <div class="data-item">
                  <label>车船费</label>
                  <span>{{ travels[0].amountShip }}</span>
                </div>
                <div class="data-item">
                  <label>伙食补助</label>
                  <span>{{ travels[0].amountCatering }}</span>
                </div>
                <div class="data-item">
                  <label>住宿费</label>
                  <span>{{ travels[0].amountHotel }}</span>
                </div>
                <div class="data-item">
                  <label>市内交通费</label>
                  <span>{{ travels[0].amountCar }}</span>
                </div>
                <div class="data-item">
                  <label>保险费</label>
                  <span>{{ travels[0].amountInsurance }}</span>
                </div>
                <div class="data-item">
                  <label>其他费用</label>
                  <span>{{ travels[0].amountOther }}</span>
                </div>
              </div>
              <el-card class="update-log update-log-1 bgcolorgray" v-if="travelFeeFileList.length > 0">
                <label class="form-label-div">附件信息</label>
                <table width="100%" border="1" class="table-form-1">
                  <tr>
                    <th width="12%">业务环节</th>
                    <th width="12%">附件控制级别</th>
                    <th width="4%">序号</th>
                    <th width="25%">附件名称（类型）</th>
                    <th width="4%">是否发票</th>
                    <th>对应的文件</th>
                  </tr>
                  <tr v-for="(item,index) in travelFeeFileList" :key="item.id">
                    <td>{{ showEnumLabel('ExpenditureFeetypeFileStage', item.stage) }}</td>
                    <td><span style="color: #F56C6C" v-if="item.control === '1'">*</span>{{ showEnumLabel('ExpenditureFeetypeFileControl', item.control) }}</td>
                    <td>{{ (index + 1) }}</td>
                    <td>
                      <div>{{ item.filename }}</div>
                      <div style="color: #999;font-size: .8125rem;">{{ itemNaNpxark }}</div>
                    </td>
                    <td :style="{color: item.needInvoice ==='1' ? '#F56C6C' : ''}">{{ showEnumLabel('CommonYesNo', item.needInvoice) }}</td>
                    <td style="text-align: left;">
                      <ul class="files-url">
                        <li v-for="item1 in item.files" :key="item1.id">
                          <div class="file-text">
                            <div>
                              <span class="file-name">{{ item1.attachmentName }}</span>
                              <span class="file-kb">{{ bytesToSize(item1.attachmentSize) }}</span>
                            </div>
                            <div>
                              <span class="file-time">{{ showIdLabel(userList, item1.attachmentUploader, 'name') }}<span style="color:#333;">上传于</span>{{ item1.attachmentUpload }}</span>
                            </div>
                          </div>
                          <div class="file-btn">
                            <el-button type="primary" link @click="downloadFile(item1)">下载</el-button>
                            <el-button type="primary" link @click="handlePreview(item1)">预览</el-button>
                            <el-popover placement="bottom" :width="900" trigger="click">
                              <template #reference>
                                <el-button type="primary" link v-show="item.needInvoice !== '0'">发票详情</el-button>
                              </template>
                              <div class="report-form-list-content report-form-list-content-be">
                                <div class="data-item">
                                  <label>发票代码</label>
                                  <span>{{ item1.invoiceCode }}</span>
                                </div>
                                <div class="data-item">
                                  <label>发票号码</label>
                                  <span>{{ item1.invoiceNumber }}</span>
                                </div>
                                <div class="data-item">
                                  <label>开票日期</label>
                                  <span>{{ item1.invoiceDate }}</span>
                                </div>
                                <div class="data-item">
                                  <label>价税合计（元）</label>
                                  <span>{{ item1.invoiceTotal }}</span>
                                </div>
                                <div class="data-item">
                                  <label>校验码</label>
                                  <span>{{ item1.invoiceValid }}</span>
                                </div>
                                <div class="data-item">
                                  <label>发票名称</label>
                                  <span>{{ item1.invoiceBuyerName }}</span>
                                </div>
                                <div class="data-item">
                                  <label>价税合计(大写)</label>
                                  <span>{{ item1.invoiceTotalText }}</span>
                                </div>
                                <div class="data-item">
                                  <label>价税合计(小写)</label>
                                  <span>{{ item1.invoiceTotal }}</span>
                                </div>
                                <div class="data-item">
                                  <label>销售方名称</label>
                                  <span>{{ item1.invoiceSellerName }}</span>
                                </div>
                                <div class="data-item">
                                  <label>销售方纳税人识别号</label>
                                  <span>{{ item1.invoiceSeller }}</span>
                                </div>
                                <div class="data-item">
                                  <label>销售方开户行及账号</label>
                                  <span>{{ item1.invoiceSellerBank }}</span>
                                </div>
                                <div class="data-item">
                                  <label>销售方地址/电话</label>
                                  <span>{{ item1.invoiceSellerInfo }}</span>
                                </div>
                                <div class="data-item">
                                  <label>收款人</label>
                                  <span>{{ item1.invoicePayee }}</span>
                                </div>
                                <div class="data-item">
                                  <label>开票人</label>
                                  <span>{{ item1.invoicePrinter }}</span>
                                </div>
                                <div class="data-item">
                                  <label>复核</label>
                                  <span>{{ item1.invoiceApprover }}</span>
                                </div>
                              </div>
                            </el-popover>
                          </div>
                        </li>
                      </ul>
                    </td>
                  </tr>
                </table>
              </el-card>
            </el-card>
          </el-col>
          <!--合同报销明细-->
          <el-col :sm="24" :lg="29" style="padding-left: 1.25rem" v-if="contracts.length > 0">
            <div class="" style="display: flex;align-items: center;">
              <h2>合同报销明细</h2>
            </div>
            <el-card class="update-log bgcolorgray">
              <div class="report-form-list-content">
                <div class="data-item">
                  <label>合同编号</label>
                  <span>{{ contracts[0].contractNo }}</span>
                </div>
                <div class="data-item">
                  <label>合同名称</label>
                  <span>{{ contracts[0].contractName }}</span>
                </div>
                <div class="data-item">
                  <label>合同支付条件</label>
                  <span>{{ contracts[0].contractCondition }}</span>
                </div>
                <div class="data-item">
                  <label>合同主体内容</label>
                  <span>{{ contracts[0].contractContent }}</span>
                </div>
                <div class="data-item">
                  <label>合同支付费</label>
                  <span>{{ contracts[0].amountContract }}</span>
                </div>
                <div class="data-item">
                  <label>其他费</label>
                  <span>{{ contracts[0].amountOther }}</span>
                </div>
              </div>
              <el-card class="update-log update-log-1 bgcolorgray" v-if="contractFeeFileList.length > 0">
                  <label class="form-label-div">附件信息</label>
                  <table width="100%" border="1" class="table-form-1">
                      <tr>
                      <th width="12%">业务环节</th>
                      <th width="12%">附件控制级别</th>
                      <th width="4%">序号</th>
                      <th width="25%">附件名称（类型）</th>
                      <th width="4%">是否发票</th>
                      <th>对应的文件</th>
                      </tr>
                      <tr v-for="(item,index) in contractFeeFileList" :key="item.id">
                      <td>{{ showEnumLabel('ExpenditureFeetypeFileStage', item.stage) }}</td>
                      <td><span style="color: #F56C6C" v-if="item.control === '1'">*</span>{{ showEnumLabel('ExpenditureFeetypeFileControl', item.control) }}</td>
                      <td>{{ (index + 1) }}</td>
                      <td>
                          <div>{{ item.filename }}</div>
                          <div style="color: #999;font-size: .8125rem;">{{ itemNaNpxark }}</div>
                      </td>
                      <td :style="{color: item.needInvoice ==='1' ? '#F56C6C' : ''}">{{ showEnumLabel('CommonYesNo', item.needInvoice) }}</td>
                      <td style="text-align: left;">
                          <ul class="files-url">
                              <li v-for="item1 in item.files" :key="item1.id">
                                  <div class="file-text">
                                  <div>
                                      <span class="file-name">{{ item1.attachmentName }}</span>
                                      <span class="file-kb">{{ bytesToSize(item1.attachmentSize) }}</span>
                                  </div>
                                  <div>
                                      <span class="file-time">{{ showIdLabel(userList, item1.attachmentUploader, 'name') }}<span style="color:#333;">上传于</span>{{ item1.attachmentUpload }}</span>
                                  </div>
                                  </div>
                                  <div class="file-btn">
                                  <el-button type="primary" link @click="downloadFile(item1)">下载</el-button>
                                  <el-button type="primary" link @click="handlePreview(item1)">预览</el-button>
                                  <el-popover placement="bottom" :width="900" trigger="click">
                                      <template #reference>
                                      <el-button type="primary" link v-show="item.needInvoice !== '0'">发票详情</el-button>
                                      </template>
                                      <div class="report-form-list-content report-form-list-content-be">
                                          <div class="data-item">
                                              <label>发票代码</label>
                                              <span>{{ item1.invoiceCode }}</span>
                                          </div>
                                          <div class="data-item">
                                              <label>发票号码</label>
                                              <span>{{ item1.invoiceNumber }}</span>
                                          </div>
                                          <div class="data-item">
                                              <label>开票日期</label>
                                              <span>{{ item1.invoiceDate }}</span>
                                          </div>
                                          <div class="data-item">
                                              <label>价税合计（元）</label>
                                              <span>{{ item1.invoiceTotal }}</span>
                                          </div>
                                          <div class="data-item">
                                              <label>校验码</label>
                                              <span>{{ item1.invoiceValid }}</span>
                                          </div>
                                          <div class="data-item">
                                              <label>发票名称</label>
                                              <span>{{ item1.invoiceBuyerName }}</span>
                                          </div>
                                          <div class="data-item">
                                              <label>价税合计(大写)</label>
                                              <span>{{ item1.invoiceTotalText }}</span>
                                          </div>
                                          <div class="data-item">
                                              <label>价税合计(小写)</label>
                                              <span>{{ item1.invoiceTotal }}</span>
                                          </div>
                                          <div class="data-item">
                                              <label>销售方名称</label>
                                              <span>{{ item1.invoiceSellerName }}</span>
                                          </div>
                                          <div class="data-item">
                                              <label>销售方纳税人识别号</label>
                                              <span>{{ item1.invoiceSeller }}</span>
                                          </div>
                                          <div class="data-item">
                                              <label>销售方开户行及账号</label>
                                              <span>{{ item1.invoiceSellerBank }}</span>
                                          </div>
                                          <div class="data-item">
                                              <label>销售方地址/电话</label>
                                              <span>{{ item1.invoiceSellerInfo }}</span>
                                          </div>
                                          <div class="data-item">
                                              <label>收款人</label>
                                              <span>{{ item1.invoicePayee }}</span>
                                          </div>
                                          <div class="data-item">
                                              <label>开票人</label>
                                              <span>{{ item1.invoicePrinter }}</span>
                                          </div>
                                          <div class="data-item">
                                              <label>复核</label>
                                              <span>{{ item1.invoiceApprover }}</span>
                                          </div>
                                      </div>
                                  </el-popover>
                                  </div>
                              </li>
                          </ul>
                      </td>
                      </tr>
                  </table>
              </el-card>
            </el-card>
          </el-col>
          <!--会议费明细-->
          <el-col :sm="24" :lg="29" style="padding-left: 1.25rem" v-if="meetings.length > 0">
            <div class="" style="display: flex;align-items: center;">
              <h2>会议费明细</h2>
            </div>
            <el-card class="update-log bgcolorgray">
              <div class="data-item data-item-1">
                <label>会议通过文号</label>
                <span>{{ meetings[0].meetingNotice }}</span>
              </div>
              <div class="report-form-list-content">
                <div class="data-item">
                  <label>会议计划</label>
                  <span>{{ meetings[0].meetingPlan }}</span>
                </div>
                <div class="data-item">
                  <label>会议地点</label>
                  <span>{{ meetings[0].meetingAddress }}</span>
                </div>
                <div class="data-item">
                  <label>会议类别</label>
                  <span>{{ meetings[0].meetingType }}</span>
                </div>
                <div class="data-item">
                  <label>会议开始时间</label>
                  <span>{{ meetings[0].meetingStart }}</span>
                </div>
                <div class="data-item">
                  <label>会议结束时间</label>
                  <span>{{ meetings[0].meetingEnd }}</span>
                </div>
                <div class="data-item">
                  <label>天数</label>
                  <span>{{ meetings[0].meetingDays }}</span>
                </div>
                <div class="data-item">
                  <label>参会部门</label>
                  <span>{{ meetings[0].meetingPeoples }}</span>
                </div>
                <div class="data-item">
                  <label>参会人数</label>
                  <span>{{ meetings[0].meetingPeoples }}</span>
                </div>
                <div class="data-item">
                  <label>住宿费</label>
                  <span>{{ meetings[0].amountHotel }}</span>
                </div>
                <div class="data-item">
                  <label>伙食费</label>
                  <span>{{ meetings[0].amountCatering }}</span>
                </div>
                <div class="data-item">
                  <label>交通费</label>
                  <span>{{ meetings[0].amountCar }}</span>
                </div>
                <div class="data-item">
                  <label>会议室租金</label>
                  <span>{{ meetings[0].amountRent }}</span>
                </div>
                <div class="data-item">
                  <label>文印费</label>
                  <span>{{ meetings[0].amountPaper }}</span>
                </div>
                <div class="data-item">
                  <label>医药费</label>
                  <span>{{ meetings[0].amountMedicine }}</span>
                </div>
                <div class="data-item">
                  <label>其他费用</label>
                  <span>{{ meetings[0].amountOther }}</span>
                </div>
              </div>
              <div class="data-item data-item-1">
                <label>会议内容</label>
                <span>{{meetings[0].meetingContent}}</span>
              </div>
              <el-card class="update-log update-log-1 bgcolorgray" v-if="meetingFeeFileList.length > 0">
                  <label class="form-label-div">附件信息</label>
                  <table width="100%" border="1" class="table-form-1">
                      <tr>
                      <th width="12%">业务环节</th>
                      <th width="12%">附件控制级别</th>
                      <th width="4%">序号</th>
                      <th width="25%">附件名称（类型）</th>
                      <th width="4%">是否发票</th>
                      <th>对应的文件</th>
                      </tr>
                      <tr v-for="(item,index) in meetingFeeFileList" :key="item.id">
                      <td>{{ showEnumLabel('ExpenditureFeetypeFileStage', item.stage) }}</td>
                      <td><span style="color: #F56C6C" v-if="item.control === '1'">*</span>{{ showEnumLabel('ExpenditureFeetypeFileControl', item.control) }}</td>
                      <td>{{ (index + 1) }}</td>
                      <td>
                          <div>{{ item.filename }}</div>
                          <div style="color: #999;font-size: .8125rem;">{{ itemNaNpxark }}</div>
                      </td>
                      <td :style="{color: item.needInvoice ==='1' ? '#F56C6C' : ''}">{{ showEnumLabel('CommonYesNo', item.needInvoice) }}</td>
                      <td style="text-align: left;">
                          <ul class="files-url">
                              <li v-for="item1 in item.files" :key="item1.id">
                                  <div class="file-text">
                                  <div>
                                      <span class="file-name">{{ item1.attachmentName }}</span>
                                      <span class="file-kb">{{ bytesToSize(item1.attachmentSize) }}</span>
                                  </div>
                                  <div>
                                      <span class="file-time">{{ showIdLabel(userList, item1.attachmentUploader, 'name') }}<span style="color:#333;">上传于</span>{{ item1.attachmentUpload }}</span>
                                  </div>
                                  </div>
                                  <div class="file-btn">
                                  <el-button type="primary" link @click="downloadFile(item1)">下载</el-button>
                                  <el-button type="primary" link @click="handlePreview(item1)">预览</el-button>
                                  <el-popover placement="bottom" :width="900" trigger="click">
                                      <template #reference>
                                      <el-button type="primary" link v-show="item.needInvoice !== '0'">发票详情</el-button>
                                      </template>
                                      <div class="report-form-list-content report-form-list-content-be">
                                          <div class="data-item">
                                              <label>发票代码</label>
                                              <span>{{ item1.invoiceCode }}</span>
                                          </div>
                                          <div class="data-item">
                                              <label>发票号码</label>
                                              <span>{{ item1.invoiceNumber }}</span>
                                          </div>
                                          <div class="data-item">
                                              <label>开票日期</label>
                                              <span>{{ item1.invoiceDate }}</span>
                                          </div>
                                          <div class="data-item">
                                              <label>价税合计（元）</label>
                                              <span>{{ item1.invoiceTotal }}</span>
                                          </div>
                                          <div class="data-item">
                                              <label>校验码</label>
                                              <span>{{ item1.invoiceValid }}</span>
                                          </div>
                                          <div class="data-item">
                                              <label>发票名称</label>
                                              <span>{{ item1.invoiceBuyerName }}</span>
                                          </div>
                                          <div class="data-item">
                                              <label>价税合计(大写)</label>
                                              <span>{{ item1.invoiceTotalText }}</span>
                                          </div>
                                          <div class="data-item">
                                              <label>价税合计(小写)</label>
                                              <span>{{ item1.invoiceTotal }}</span>
                                          </div>
                                          <div class="data-item">
                                              <label>销售方名称</label>
                                              <span>{{ item1.invoiceSellerName }}</span>
                                          </div>
                                          <div class="data-item">
                                              <label>销售方纳税人识别号</label>
                                              <span>{{ item1.invoiceSeller }}</span>
                                          </div>
                                          <div class="data-item">
                                              <label>销售方开户行及账号</label>
                                              <span>{{ item1.invoiceSellerBank }}</span>
                                          </div>
                                          <div class="data-item">
                                              <label>销售方地址/电话</label>
                                              <span>{{ item1.invoiceSellerInfo }}</span>
                                          </div>
                                          <div class="data-item">
                                              <label>收款人</label>
                                              <span>{{ item1.invoicePayee }}</span>
                                          </div>
                                          <div class="data-item">
                                              <label>开票人</label>
                                              <span>{{ item1.invoicePrinter }}</span>
                                          </div>
                                          <div class="data-item">
                                              <label>复核</label>
                                              <span>{{ item1.invoiceApprover }}</span>
                                          </div>
                                      </div>
                                  </el-popover>
                                  </div>
                              </li>
                          </ul>
                      </td>
                      </tr>
                  </table>
              </el-card>
            </el-card>
          </el-col>
          <!--培训费明细-->
          <el-col :sm="24" :lg="29" style="padding-left: 1.25rem" v-if="trainings.length > 0">
            <div class="" style="display: flex;align-items: center;">
              <h2>培训费明细</h2>
            </div>
            <el-card class="update-log bgcolorgray">
              <div class="report-form-list-content">
                  <div class="data-item">
                <label>培训通知文号</label>
                <span>{{ trainings[0].trainingNotice }}</span>
              </div>
                <div class="data-item">
                  <label>培训地点</label>
                  <span>{{ trainings[0].trainingAddress }}</span>
                </div>
                <div class="data-item">
                  <label>培训部门</label>
                  <span>{{ trainings[0].trainingDepartment }}</span>
                </div>
                <div class="data-item">
                  <label>培训人数</label>
                  <span>{{ trainings[0].trainingPeoples }}</span>
                </div>
                <div class="data-item">
                  <label>培训天数</label>
                  <span>{{ trainings[0].trainingDays }}</span>
                </div>
                <div class="data-item">
                  <label>工作人员数</label>
                  <span>{{ trainings[0].trainingWorkers }}</span>
                </div>
                <div class="data-item">
                  <label>培训开始时间</label>
                  <span>{{ trainings[0].trainingStart }}</span>
                </div>
                <div class="data-item">
                  <label>培训结束时间</label>
                  <span>{{ trainings[0].trainingEnd }}</span>
                </div>
                <div class="data-item">
                  <label>票据数</label>
                  <span>{{ trainings[0].trainingInvoices }}</span>
                </div>
                <div class="data-item">
                  <label>场地租金费</label>
                  <span>{{ trainings[0].amountPlace }}</span>
                </div>
                <div class="data-item">
                  <label>讲课费</label>
                  <span>{{ trainings[0].amountTeach}}</span>
                </div>
                <div class="data-item">
                  <label>伙食费</label>
                  <span>{{ trainings[0].amountCatering }}</span>
                </div>
                <div class="data-item">
                  <label>住宿费</label>
                  <span>{{ trainings[0].amountHotel }}</span>
                </div>
                <div class="data-item">
                  <label>其他费用</label>
                  <span>{{ trainings[0].amountOther }}</span>
                </div>
              </div>
              <el-card class="update-log update-log-1 bgcolorgray" v-if="trainingFeeFileList.length > 0">
                  <label class="form-label-div">附件信息</label>
                  <table width="100%" border="1" class="table-form-1">
                      <tr>
                      <th width="12%">业务环节</th>
                      <th width="12%">附件控制级别</th>
                      <th width="4%">序号</th>
                      <th width="25%">附件名称（类型）</th>
                      <th width="4%">是否发票</th>
                      <th>对应的文件</th>
                      </tr>
                      <tr v-for="(item,index) in trainingFeeFileList" :key="item.id">
                      <td>{{ showEnumLabel('ExpenditureFeetypeFileStage', item.stage) }}</td>
                      <td><span style="color: #F56C6C" v-if="item.control === '1'">*</span>{{ showEnumLabel('ExpenditureFeetypeFileControl', item.control) }}</td>
                      <td>{{ (index + 1) }}</td>
                      <td>
                          <div>{{ item.filename }}</div>
                          <div style="color: #999;font-size: .8125rem;">{{ itemNaNpxark }}</div>
                      </td>
                      <td :style="{color: item.needInvoice ==='1' ? '#F56C6C' : ''}">{{ showEnumLabel('CommonYesNo', item.needInvoice) }}</td>
                      <td style="text-align: left;">
                          <ul class="files-url">
                              <li v-for="item1 in item.files" :key="item1.id">
                                  <div class="file-text">
                                  <div>
                                      <span class="file-name">{{ item1.attachmentName }}</span>
                                      <span class="file-kb">{{ bytesToSize(item1.attachmentSize) }}</span>
                                  </div>
                                  <div>
                                      <span class="file-time">{{ showIdLabel(userList, item1.attachmentUploader, 'name') }}<span style="color:#333;">上传于</span>{{ item1.attachmentUpload }}</span>
                                  </div>
                                  </div>
                                  <div class="file-btn">
                                  <el-button type="primary" link @click="downloadFile(item1)">下载</el-button>
                                  <el-button type="primary" link @click="handlePreview(item1)">预览</el-button>
                                  <el-popover placement="bottom" :width="900" trigger="click">
                                      <template #reference>
                                      <el-button type="primary" link v-show="item.needInvoice !== '0'">发票详情</el-button>
                                      </template>
                                      <div class="report-form-list-content report-form-list-content-be">
                                          <div class="data-item">
                                              <label>发票代码</label>
                                              <span>{{ item1.invoiceCode }}</span>
                                          </div>
                                          <div class="data-item">
                                              <label>发票号码</label>
                                              <span>{{ item1.invoiceNumber }}</span>
                                          </div>
                                          <div class="data-item">
                                              <label>开票日期</label>
                                              <span>{{ item1.invoiceDate }}</span>
                                          </div>
                                          <div class="data-item">
                                              <label>价税合计（元）</label>
                                              <span>{{ item1.invoiceTotal }}</span>
                                          </div>
                                          <div class="data-item">
                                              <label>校验码</label>
                                              <span>{{ item1.invoiceValid }}</span>
                                          </div>
                                          <div class="data-item">
                                              <label>发票名称</label>
                                              <span>{{ item1.invoiceBuyerName }}</span>
                                          </div>
                                          <div class="data-item">
                                              <label>价税合计(大写)</label>
                                              <span>{{ item1.invoiceTotalText }}</span>
                                          </div>
                                          <div class="data-item">
                                              <label>价税合计(小写)</label>
                                              <span>{{ item1.invoiceTotal }}</span>
                                          </div>
                                          <div class="data-item">
                                              <label>销售方名称</label>
                                              <span>{{ item1.invoiceSellerName }}</span>
                                          </div>
                                          <div class="data-item">
                                              <label>销售方纳税人识别号</label>
                                              <span>{{ item1.invoiceSeller }}</span>
                                          </div>
                                          <div class="data-item">
                                              <label>销售方开户行及账号</label>
                                              <span>{{ item1.invoiceSellerBank }}</span>
                                          </div>
                                          <div class="data-item">
                                              <label>销售方地址/电话</label>
                                              <span>{{ item1.invoiceSellerInfo }}</span>
                                          </div>
                                          <div class="data-item">
                                              <label>收款人</label>
                                              <span>{{ item1.invoicePayee }}</span>
                                          </div>
                                          <div class="data-item">
                                              <label>开票人</label>
                                              <span>{{ item1.invoicePrinter }}</span>
                                          </div>
                                          <div class="data-item">
                                              <label>复核</label>
                                              <span>{{ item1.invoiceApprover }}</span>
                                          </div>
                                      </div>
                                  </el-popover>
                                  </div>
                              </li>
                          </ul>
                      </td>
                      </tr>
                  </table>
              </el-card>
            </el-card>
          </el-col>
          <!--市内交通费明细-->
          <el-col :sm="24" :lg="29" style="padding-left: 1.25rem" v-if="traffics.length > 0">
            <div class="" style="display: flex;align-items: center;">
              <h2>市内交通费明细</h2>
            </div>
            <el-card class="update-log bgcolorgray">
              <div class="report-form-list-content">
                  <div class="data-item">
                <label>部门</label>
                <span>{{ traffics[0].trafficDepartment }}</span>
              </div>
                <div class="data-item">
                  <label>日期</label>
                  <span>{{ traffics[0].trafficDate?.substring(0, 10) }}</span>
                </div>
                <div class="data-item">
                  <label>人员</label>
                  <span>{{ traffics[0].trafficName }}</span>
                </div>
                <div class="data-item">
                  <label>金额</label>
                  <span>{{ traffics[0].amountCar }}</span>
                </div>
              </div>
              <el-card class="update-log update-log-1 bgcolorgray" v-if="trafficFeeFileList.length > 0">
                  <label class="form-label-div">附件信息</label>
                  <table width="100%" border="1" class="table-form-1">
                      <tr>
                      <th width="12%">业务环节</th>
                      <th width="12%">附件控制级别</th>
                      <th width="4%">序号</th>
                      <th width="25%">附件名称（类型）</th>
                      <th width="4%">是否发票</th>
                      <th>对应的文件</th>
                      </tr>
                      <tr v-for="(item,index) in trafficFeeFileList" :key="item.id">
                      <td>{{ showEnumLabel('ExpenditureFeetypeFileStage', item.stage) }}</td>
                      <td><span style="color: #F56C6C" v-if="item.control === '1'">*</span>{{ showEnumLabel('ExpenditureFeetypeFileControl', item.control) }}</td>
                      <td>{{ (index + 1) }}</td>
                      <td>
                          <div>{{ item.filename }}</div>
                          <div style="color: #999;font-size: .8125rem;">{{ itemNaNpxark }}</div>
                      </td>
                      <td :style="{color: item.needInvoice ==='1' ? '#F56C6C' : ''}">{{ showEnumLabel('CommonYesNo', item.needInvoice) }}</td>
                      <td style="text-align: left;">
                          <ul class="files-url">
                              <li v-for="item1 in item.files" :key="item1.id">
                                  <div class="file-text">
                                  <div>
                                      <span class="file-name">{{ item1.attachmentName }}</span>
                                      <span class="file-kb">{{ bytesToSize(item1.attachmentSize) }}</span>
                                  </div>
                                  <div>
                                      <span class="file-time">{{ showIdLabel(userList, item1.attachmentUploader, 'name') }}<span style="color:#333;">上传于</span>{{ item1.attachmentUpload }}</span>
                                  </div>
                                  </div>
                                  <div class="file-btn">
                                  <el-button type="primary" link @click="downloadFile(item1)">下载</el-button>
                                  <el-button type="primary" link @click="handlePreview(item1)">预览</el-button>
                                  <el-popover placement="bottom" :width="900" trigger="click">
                                      <template #reference>
                                      <el-button type="primary" link v-show="item.needInvoice !== '0'">发票详情</el-button>
                                      </template>
                                      <div class="report-form-list-content report-form-list-content-be">
                                          <div class="data-item">
                                              <label>发票代码</label>
                                              <span>{{ item1.invoiceCode }}</span>
                                          </div>
                                          <div class="data-item">
                                              <label>发票号码</label>
                                              <span>{{ item1.invoiceNumber }}</span>
                                          </div>
                                          <div class="data-item">
                                              <label>开票日期</label>
                                              <span>{{ item1.invoiceDate }}</span>
                                          </div>
                                          <div class="data-item">
                                              <label>价税合计（元）</label>
                                              <span>{{ item1.invoiceTotal }}</span>
                                          </div>
                                          <div class="data-item">
                                              <label>校验码</label>
                                              <span>{{ item1.invoiceValid }}</span>
                                          </div>
                                          <div class="data-item">
                                              <label>发票名称</label>
                                              <span>{{ item1.invoiceBuyerName }}</span>
                                          </div>
                                          <div class="data-item">
                                              <label>价税合计(大写)</label>
                                              <span>{{ item1.invoiceTotalText }}</span>
                                          </div>
                                          <div class="data-item">
                                              <label>价税合计(小写)</label>
                                              <span>{{ item1.invoiceTotal }}</span>
                                          </div>
                                          <div class="data-item">
                                              <label>销售方名称</label>
                                              <span>{{ item1.invoiceSellerName }}</span>
                                          </div>
                                          <div class="data-item">
                                              <label>销售方纳税人识别号</label>
                                              <span>{{ item1.invoiceSeller }}</span>
                                          </div>
                                          <div class="data-item">
                                              <label>销售方开户行及账号</label>
                                              <span>{{ item1.invoiceSellerBank }}</span>
                                          </div>
                                          <div class="data-item">
                                              <label>销售方地址/电话</label>
                                              <span>{{ item1.invoiceSellerInfo }}</span>
                                          </div>
                                          <div class="data-item">
                                              <label>收款人</label>
                                              <span>{{ item1.invoicePayee }}</span>
                                          </div>
                                          <div class="data-item">
                                              <label>开票人</label>
                                              <span>{{ item1.invoicePrinter }}</span>
                                          </div>
                                          <div class="data-item">
                                              <label>复核</label>
                                              <span>{{ item1.invoiceApprover }}</span>
                                          </div>
                                      </div>
                                  </el-popover>
                                  </div>
                              </li>
                          </ul>
                      </td>
                      </tr>
                  </table>
              </el-card>
            </el-card>
          </el-col>
          <!--出国（境）费明细-->
          <el-col :sm="24" :lg="29" style="padding-left: 1.25rem" v-if="abroads.length > 0">
            <div class="" style="display: flex;align-items: center;">
              <h2>出国（境）费明细</h2>
            </div>
            <el-card class="update-log bgcolorgray">
              <div class="report-form-list-content">
                <div class="data-item">
                  <label>出国地点</label>
                  <span>{{ abroads[0].abroadAddress }}</span>
                </div>
                <div class="data-item">
                  <label>出国日期</label>
                  <span>{{ abroads[0].abroadStart?.substring(0, 10) }}</span>
                </div>
                <div class="data-item">
                  <label>回国日期</label>
                  <span>{{ abroads[0].abroadEnd?.substring(0, 10) }}</span>
                </div>
                <div class="data-item">
                  <label>出国计划</label>
                  <span>{{ abroads[0].abroadPlan }}</span>
                </div>
                <div class="data-item">
                  <label>部门</label>
                  <span>{{ abroads[0].abroadDepartment }}</span>
                </div>
                <div class="data-item">
                  <label>人员</label>
                  <span>{{ abroads[0].abroadPeoples }}</span>
                </div>
                <div class="data-item">
                  <label>事由内容</label>
                  <span>{{ abroads[0].abroadContent }}</span>
                </div>
                <div class="data-item">
                  <label>交通费</label>
                  <span>{{ abroads[0].amountCar }}</span>
                </div>
                <div class="data-item">
                  <label>伙食费</label>
                  <span>{{ abroads[0].amountCatering }}</span>
                </div>
                <div class="data-item">
                  <label>团组统报费</label>
                  <span>{{ abroads[0].amountTeam }}</span>
                </div>
                <div class="data-item">
                  <label>领用费</label>
                  <span>{{ abroads[0].amountLead }}</span>
                </div>
                <div class="data-item">
                  <label>住宿费</label>
                  <span>{{ abroads[0].amountHotel }}</span>
                </div>
                <div class="data-item">
                  <label>公杂费</label>
                  <span>{{ abroads[0].amountSundry }}</span>
                </div>
                <div class="data-item">
                  <label>其他费用</label>
                  <span>{{ abroads[0].amountOther }}</span>
                </div>
              </div>
              <el-card class="update-log update-log-1 bgcolorgray" v-if="abroadFeeFileList.length > 0">
                  <label class="form-label-div">附件信息</label>
                  <table width="100%" border="1" class="table-form-1">
                      <tr>
                      <th width="12%">业务环节</th>
                      <th width="12%">附件控制级别</th>
                      <th width="4%">序号</th>
                      <th width="25%">附件名称（类型）</th>
                      <th width="4%">是否发票</th>
                      <th>对应的文件</th>
                      </tr>
                      <tr v-for="(item,index) in abroadFeeFileList" :key="item.id">
                      <td>{{ showEnumLabel('ExpenditureFeetypeFileStage', item.stage) }}</td>
                      <td><span style="color: #F56C6C" v-if="item.control === '1'">*</span>{{ showEnumLabel('ExpenditureFeetypeFileControl', item.control) }}</td>
                      <td>{{ (index + 1) }}</td>
                      <td>
                          <div>{{ item.filename }}</div>
                          <div style="color: #999;font-size: .8125rem;">{{ itemNaNpxark }}</div>
                      </td>
                      <td :style="{color: item.needInvoice ==='1' ? '#F56C6C' : ''}">{{ showEnumLabel('CommonYesNo', item.needInvoice) }}</td>
                      <td style="text-align: left;">
                          <ul class="files-url">
                              <li v-for="item1 in item.files" :key="item1.id">
                                  <div class="file-text">
                                  <div>
                                      <span class="file-name">{{ item1.attachmentName }}</span>
                                      <span class="file-kb">{{ bytesToSize(item1.attachmentSize) }}</span>
                                  </div>
                                  <div>
                                      <span class="file-time">{{ showIdLabel(userList, item1.attachmentUploader, 'name') }}<span style="color:#333;">上传于</span>{{ item1.attachmentUpload }}</span>
                                  </div>
                                  </div>
                                  <div class="file-btn">
                                  <el-button type="primary" link @click="downloadFile(item1)">下载</el-button>
                                  <el-button type="primary" link @click="handlePreview(item1)">预览</el-button>
                                  <el-popover placement="bottom" :width="900" trigger="click">
                                      <template #reference>
                                      <el-button type="primary" link v-show="item.needInvoice !== '0'">发票详情</el-button>
                                      </template>
                                      <div class="report-form-list-content report-form-list-content-be">
                                          <div class="data-item">
                                              <label>发票代码</label>
                                              <span>{{ item1.invoiceCode }}</span>
                                          </div>
                                          <div class="data-item">
                                              <label>发票号码</label>
                                              <span>{{ item1.invoiceNumber }}</span>
                                          </div>
                                          <div class="data-item">
                                              <label>开票日期</label>
                                              <span>{{ item1.invoiceDate }}</span>
                                          </div>
                                          <div class="data-item">
                                              <label>价税合计（元）</label>
                                              <span>{{ item1.invoiceTotal }}</span>
                                          </div>
                                          <div class="data-item">
                                              <label>校验码</label>
                                              <span>{{ item1.invoiceValid }}</span>
                                          </div>
                                          <div class="data-item">
                                              <label>发票名称</label>
                                              <span>{{ item1.invoiceBuyerName }}</span>
                                          </div>
                                          <div class="data-item">
                                              <label>价税合计(大写)</label>
                                              <span>{{ item1.invoiceTotalText }}</span>
                                          </div>
                                          <div class="data-item">
                                              <label>价税合计(小写)</label>
                                              <span>{{ item1.invoiceTotal }}</span>
                                          </div>
                                          <div class="data-item">
                                              <label>销售方名称</label>
                                              <span>{{ item1.invoiceSellerName }}</span>
                                          </div>
                                          <div class="data-item">
                                              <label>销售方纳税人识别号</label>
                                              <span>{{ item1.invoiceSeller }}</span>
                                          </div>
                                          <div class="data-item">
                                              <label>销售方开户行及账号</label>
                                              <span>{{ item1.invoiceSellerBank }}</span>
                                          </div>
                                          <div class="data-item">
                                              <label>销售方地址/电话</label>
                                              <span>{{ item1.invoiceSellerInfo }}</span>
                                          </div>
                                          <div class="data-item">
                                              <label>收款人</label>
                                              <span>{{ item1.invoicePayee }}</span>
                                          </div>
                                          <div class="data-item">
                                              <label>开票人</label>
                                              <span>{{ item1.invoicePrinter }}</span>
                                          </div>
                                          <div class="data-item">
                                              <label>复核</label>
                                              <span>{{ item1.invoiceApprover }}</span>
                                          </div>
                                      </div>
                                  </el-popover>
                                  </div>
                              </li>
                          </ul>
                      </td>
                      </tr>
                  </table>
              </el-card>
            </el-card>
          </el-col>
          <!--其他费用-->
          <el-col :sm="24" :lg="29" style="padding-left: 1.25rem" v-if="others.length > 0">
            <div class="" style="display: flex;align-items: center;">
              <h2>出国（境）费明细</h2>
            </div>
            <el-card class="update-log bgcolorgray">
              <div class="report-form-list-content">
                <div class="data-item">
                  <label>日期</label>
                  <span>{{ others[0].otherDate }}</span>
                </div>
                <div class="data-item">
                  <label>部门</label>
                  <span>{{ others[0].otherDepartment }}</span>
                </div>
                <div class="data-item">
                  <label>人员</label>
                  <span>{{ others[0].otherName }}</span>
                </div>
                <div class="data-item">
                  <label>金额</label>
                  <span>{{ others[0].amountOther }}</span>
                </div>

              </div>
              <el-card class="update-log update-log-1 bgcolorgray" v-if="othersFeeFileList.length > 0">
                  <label class="form-label-div">附件信息</label>
                  <table width="100%" border="1" class="table-form-1">
                      <tr>
                      <th width="12%">业务环节</th>
                      <th width="12%">附件控制级别</th>
                      <th width="4%">序号</th>
                      <th width="25%">附件名称（类型）</th>
                      <th width="4%">是否发票</th>
                      <th>对应的文件</th>
                      </tr>
                      <tr v-for="(item,index) in othersFeeFileList" :key="item.id">
                      <td>{{ showEnumLabel('ExpenditureFeetypeFileStage', item.stage) }}</td>
                      <td><span style="color: #F56C6C" v-if="item.control === '1'">*</span>{{ showEnumLabel('ExpenditureFeetypeFileControl', item.control) }}</td>
                      <td>{{ (index + 1) }}</td>
                      <td>
                          <div>{{ item.filename }}</div>
                          <div style="color: #999;font-size: .8125rem;">{{ itemNaNpxark }}</div>
                      </td>
                      <td :style="{color: item.needInvoice ==='1' ? '#F56C6C' : ''}">{{ showEnumLabel('CommonYesNo', item.needInvoice) }}</td>
                      <td style="text-align: left;">
                          <ul class="files-url">
                              <li v-for="item1 in item.files" :key="item1.id">
                                  <div class="file-text">
                                  <div>
                                      <span class="file-name">{{ item1.attachmentName }}</span>
                                      <span class="file-kb">{{ bytesToSize(item1.attachmentSize) }}</span>
                                  </div>
                                  <div>
                                      <span class="file-time">{{ showIdLabel(userList, item1.attachmentUploader, 'name') }}<span style="color:#333;">上传于</span>{{ item1.attachmentUpload }}</span>
                                  </div>
                                  </div>
                                  <div class="file-btn">
                                  <el-button type="primary" link @click="downloadFile(item1)">下载</el-button>
                                  <el-button type="primary" link @click="handlePreview(item1)">预览</el-button>
                                  <el-popover placement="bottom" :width="900" trigger="click">
                                      <template #reference>
                                      <el-button type="primary" link v-show="item.needInvoice !== '0'">发票详情</el-button>
                                      </template>
                                      <div class="report-form-list-content report-form-list-content-be">
                                          <div class="data-item">
                                              <label>发票代码</label>
                                              <span>{{ item1.invoiceCode }}</span>
                                          </div>
                                          <div class="data-item">
                                              <label>发票号码</label>
                                              <span>{{ item1.invoiceNumber }}</span>
                                          </div>
                                          <div class="data-item">
                                              <label>开票日期</label>
                                              <span>{{ item1.invoiceDate }}</span>
                                          </div>
                                          <div class="data-item">
                                              <label>价税合计（元）</label>
                                              <span>{{ item1.invoiceTotal }}</span>
                                          </div>
                                          <div class="data-item">
                                              <label>校验码</label>
                                              <span>{{ item1.invoiceValid }}</span>
                                          </div>
                                          <div class="data-item">
                                              <label>发票名称</label>
                                              <span>{{ item1.invoiceBuyerName }}</span>
                                          </div>
                                          <div class="data-item">
                                              <label>价税合计(大写)</label>
                                              <span>{{ item1.invoiceTotalText }}</span>
                                          </div>
                                          <div class="data-item">
                                              <label>价税合计(小写)</label>
                                              <span>{{ item1.invoiceTotal }}</span>
                                          </div>
                                          <div class="data-item">
                                              <label>销售方名称</label>
                                              <span>{{ item1.invoiceSellerName }}</span>
                                          </div>
                                          <div class="data-item">
                                              <label>销售方纳税人识别号</label>
                                              <span>{{ item1.invoiceSeller }}</span>
                                          </div>
                                          <div class="data-item">
                                              <label>销售方开户行及账号</label>
                                              <span>{{ item1.invoiceSellerBank }}</span>
                                          </div>
                                          <div class="data-item">
                                              <label>销售方地址/电话</label>
                                              <span>{{ item1.invoiceSellerInfo }}</span>
                                          </div>
                                          <div class="data-item">
                                              <label>收款人</label>
                                              <span>{{ item1.invoicePayee }}</span>
                                          </div>
                                          <div class="data-item">
                                              <label>开票人</label>
                                              <span>{{ item1.invoicePrinter }}</span>
                                          </div>
                                          <div class="data-item">
                                              <label>复核</label>
                                              <span>{{ item1.invoiceApprover }}</span>
                                          </div>
                                      </div>
                                  </el-popover>
                                  </div>
                              </li>
                          </ul>
                      </td>
                      </tr>
                  </table>
              </el-card>
            </el-card>
          </el-col>
        </el-row>
      </div>
      <div class="tabs-list" v-show="activeName === 'third'">
        <el-row :gutter="20">
          <el-col :sm="24" :lg="29" style="padding-left: 1.25rem">
            <div class="" style="display: flex;align-items: center;">
              <h2>支出信息</h2>
            </div>
            <el-card class="update-log" v-for="(pay, idx) in pays" :key="idx">
              <div class="data-item data-item-1">
                <label>支付方式</label>
                <span><DictTag :dict-list="getDictList('ExpenditurePay')" :dict-key="pay.payType" /></span>
              </div>
              <div class="report-form-list-content">
                <div class="data-item">
                  <label>结算方式</label>
                  <span><DictTag :dict-list="getDictList('ExpenditureSettlement')" :dict-key="pay.settleType" /></span>
                </div>
                <div class="data-item">
                  <label>支付账户</label>
                  <span>{{ expenditureKpiObj.year }}</span>
                </div>
                <div class="data-item">
                  <label>收付标识</label>
                  <span><EnumTag :enum-list="getEnumList('ExpenditurePay')" :enum-key="pay.pay" /></span>
                </div>
                <div class="data-item">
                  <label>金额</label>
                  <span>￥{{ pay.amount }}</span>
                </div>
                <div class="data-item data-item-1">
                  <label>摘要</label>
                  <span>{{ pay.summary }}</span>
                </div>
              </div>
            </el-card>
            <div class="" style="display: flex;align-items: center;">
              <h2>收款方信息</h2>
            </div>
            <el-card class="update-log" v-for="(payee, idx) in payees" :key="idx">
              <div class="data-item data-item-1">
                <label>收款类型</label>
                <span><EnumTag :enum-list="getEnumList('ExpenditureReimbursementPayeeType')" :enum-key="payee.payeeType" /></span>
              </div>
              <div class="report-form-list-content">
                <div class="data-item" v-if="payee.payeeType === 'proceeds'">
                  <label>收款单位ID</label>
                  <span>{{ payee.expenditureProceedsId }}</span>
                </div>
                <div class="data-item" v-if="payee.payeeType === 'proceeds'">
                  <label>收款单位名称</label>
                  <span>{{ payee.proceedsCompany }}</span>
                </div>
                <div class="data-item" v-if="payee.payeeType === 'proceeds'">
                  <label>收款银行</label>
                  <span>{{ payee.proceedsBank }}</span>
                </div>
                <div class="data-item" v-if="payee.payeeType === 'proceeds'">
                  <label>收款账号</label>
                  <span>{{ payee.proceedsAccount }}</span>
                </div>
                <div class="data-item" v-if="payee.payeeType === 'payee'">
                  <label>公务卡ID</label>
                  <span>{{ payee.expenditureBusinessCardId }}</span>
                </div>
                <div class="data-item" v-if="payee.payeeType === 'payee'">
                  <label>公务卡持有人</label>
                  <span>{{ payee.businessCardName }}</span>
                </div>
                <div class="data-item" v-if="payee.payeeType === 'payee'">
                  <label>开户行</label>
                  <span>{{ payee.businessCardBank }}</span>
                </div>
                <div class="data-item" v-if="payee.payeeType === 'payee'">
                  <label>卡号</label>
                  <span>{{ payee.businessCardAccount }}</span>
                </div>
              </div>
              <div class="data-item data-item-1">
                <label>摘要</label>
                <span>{{ payee.summary }}</span>
              </div>
            </el-card>
          </el-col>
        </el-row>
      </div>
    </div>
  </div>
  <el-dialog v-model="attachmentVisible" title="附件预览" width="70%" top="2vh">
    <attachmentPreview v-model:attachmentId="previewAttachmentId" />
    <div style="text-align:right;">
      <el-button type="danger" @click="closeBtn">关闭</el-button>
    </div>
  </el-dialog>
</template>

<script setup>
import {ref, watch} from 'vue'
import {doGet, doGetDownload} from "@/config/http";
import {svc, showIdLabel, showEnumLabel, bytesToSize, getListPageSize, isNullOrUndefinedOrEmpty, getEnumList, getDictList} from "@/config/common";
import attachmentPreview from '@/views/components/base/attachmentPreview.vue'
import initListStore from '@/store/modules/initList'

const props = defineProps({
  expenditureReimbursementId: {
    required: true,
    type: String,
  }
})

const emit = defineEmits(['close', 'projectListSelect'])

// tab 切换
let activeName = ref('first')
// 基本数据
let obj = ref({})

// 指标单数据
let expenditureKpiObj = ref({})
// 事前申请单数据
let expenditureApplicationObj = ref({})
// 附件
let fileList = ref([])

let governmentList = initListStore().governmentList
let organizationList = initListStore().organizationList
let userList = initListStore().userList

let expenditurePtypeList = initListStore().expenditurePtypeList//项目类型
let expenditureFunctionalList = initListStore().expenditureFunctionalList//功能分类
let expenditureEconomicList = initListStore().expenditureEconomicList//经济分类
let expenditureFiscalList = initListStore().expenditureFiscalList//财政项目
let expenditureSubjectList = initListStore().expenditureSubjectList//会计科目

let travels = ref([])
let contracts = ref([])
let meetings = ref([])
let trainings = ref([])
let traffics = ref([])
let abroads = ref([])
let others = ref([])

let travelFeeFileList = ref([])
let contractFeeFileList = ref([])
let meetingFeeFileList = ref([])
let trainingFeeFileList = ref([])
let trafficFeeFileList = ref([])
let abroadFeeFileList = ref([])
let othersFeeFileList = ref([])

let arrFiles = ref([])

let files = ref([])

let attachmentVisible = ref(false)
let previewAttachmentId = ref(null)

let pays = ref([])
let payees = ref([])

watch(() => props.expenditureReimbursementId, async val => {
  await initObj(val)
  await initList(val)
},{immediate:true})

async function initList(id) {
  // let p1 = doGet(svc, '/government/page', {pageSize: getListPageSize()}, false)
  // let p2 = doGet(svc, '/organization/page', {pageSize: getListPageSize()}, false)
  // let p3 = doGet(svc, '/user/page', {pageSize: getListPageSize()}, false)
  // let p4 = doGet(svc, '/expenditure-ptype/page', {pageSize: getListPageSize()}, false)
  // let p5 = doGet(svc, '/expenditure-functional/page', {pageSize: getListPageSize()}, false)
  // let p6 = doGet(svc, '/expenditure-economic/page', {pageSize: getListPageSize()}, false)
  // let p7 = doGet(svc, '/expenditure-fiscal/page', {pageSize: getListPageSize()}, false)
  // let p8 = doGet(svc, '/expenditure-subject/page', {pageSize: getListPageSize()}, false)
  let p9 = doGet(svc, '/expenditure-feetype-file/page', {pageSize: getListPageSize()}, false) // 费用类型附件
  let p10 = doGet(svc, '/expenditure-reimbursement-item-file/page', {pageSize: getListPageSize()}, false)
  let resArray = await Promise.all([p9, p10])
  arrFiles.value = await doGet(svc, '/expenditure-reimbursement-item-file/listByField', {field: 'expenditureReimbursementId', values: id}, false)
  // governmentList.value = resArray[0]['records']
  // organizationList.value = resArray[1]['records']
  // userList.value = resArray[2]['records']
  // expenditurePtypeList.value = resArray[3]['records']
  // expenditureFunctionalList.value = resArray[4]['records']
  // expenditureEconomicList.value = resArray[5]['records']
  // expenditureFiscalList.value = resArray[6]['records']
  // expenditureSubjectList.value = resArray[7]['records']
  let allFeeFileList = resArray[0]['records']
  allFeeFileList.forEach(item => {
    item.files = []
    switch (item.expenditureFeetype) {
      case "01":
        travelFeeFileList.value.push(item)
        break
      case "02":
        contractFeeFileList.value.push(item)
        break
      case "03":
        meetingFeeFileList.value.push(item)
        break
      case "04":
        trainingFeeFileList.value.push(item)
        break
      case "05":
        trafficFeeFileList.value.push(item)
        break
      case "06":
        abroadFeeFileList.value.push(item)
        break
      case "07":
        othersFeeFileList.value.push(item)
        break
    }
  })
  fileOnList(travelFeeFileList.value)
  fileOnList(contractFeeFileList.value)
  fileOnList(meetingFeeFileList.value)
  fileOnList(trainingFeeFileList.value)
  fileOnList(trafficFeeFileList.value)
  fileOnList(abroadFeeFileList.value)
  fileOnList(othersFeeFileList.value)
  travelFeeFileList.value.sort((a, b) => {
    return a.stage !== b.stage ? a.stage - b.stage : a.control !== b.control ? a.control - b.control : a.needInvoice !== b.needInvoice ? b.needInvoice - a.needInvoice : b.weight - a.weight
  })
  contractFeeFileList.value.sort((a, b) => {
    return a.stage !== b.stage ? a.stage - b.stage : a.control !== b.control ? a.control - b.control : a.needInvoice !== b.needInvoice ? b.needInvoice - a.needInvoice : b.weight - a.weight
  })
  meetingFeeFileList.value.sort((a, b) => {
    return a.stage !== b.stage ? a.stage - b.stage : a.control !== b.control ? a.control - b.control : a.needInvoice !== b.needInvoice ? b.needInvoice - a.needInvoice : b.weight - a.weight
  })
  trainingFeeFileList.value.sort((a, b) => {
    return a.stage !== b.stage ? a.stage - b.stage : a.control !== b.control ? a.control - b.control : a.needInvoice !== b.needInvoice ? b.needInvoice - a.needInvoice : b.weight - a.weight
  })
  trafficFeeFileList.value.sort((a, b) => {
    return a.stage !== b.stage ? a.stage - b.stage : a.control !== b.control ? a.control - b.control : a.needInvoice !== b.needInvoice ? b.needInvoice - a.needInvoice : b.weight - a.weight
  })
  abroadFeeFileList.value.sort((a, b) => {
    return a.stage !== b.stage ? a.stage - b.stage : a.control !== b.control ? a.control - b.control : a.needInvoice !== b.needInvoice ? b.needInvoice - a.needInvoice : b.weight - a.weight
  })
  othersFeeFileList.value.sort((a, b) => {
    return a.stage !== b.stage ? a.stage - b.stage : a.control !== b.control ? a.control - b.control : a.needInvoice !== b.needInvoice ? b.needInvoice - a.needInvoice : b.weight - a.weight
  })
  let allItemFileList = resArray[1]['records']
  if (allItemFileList.length > 0) {
  }
}

async function initObj(id) {
  obj.value = await doGet(svc, '/expenditure-reimbursement/' + id, {}, true)
  travels.value = await doGet(svc, '/expenditure-reimbursement-travel/listByField', {field: 'expenditureReimbursementId', values: id}, false)
  contracts.value = await doGet(svc, '/expenditure-reimbursement-contract/listByField', {field: 'expenditureReimbursementId', values: id}, false)
  meetings.value = await doGet(svc, '/expenditure-reimbursement-meeting/listByField', {field: 'expenditureReimbursementId', values: id}, false)
  trainings.value = await doGet(svc, '/expenditure-reimbursement-training/listByField', {field: 'expenditureReimbursementId', values: id}, false)
  traffics.value = await doGet(svc, '/expenditure-reimbursement-traffic/listByField', {field: 'expenditureReimbursementId', values: id}, false)
  abroads.value = await doGet(svc, '/expenditure-reimbursement-abroad/listByField', {field: 'expenditureReimbursementId', values: id}, false)
  others.value = await doGet(svc, '/expenditure-reimbursement-other/listByField', {field: 'expenditureReimbursementId', values: id}, false)
  pays.value = await doGet(svc, '/expenditure-reimbursement-pay/listByField', {field: 'expenditureReimbursementId', values: id}, false)
  payees.value = await doGet(svc, '/expenditure-reimbursement-payee/listByField', {field: 'expenditureReimbursementId', values: id}, false)
  if (!isNullOrUndefinedOrEmpty(obj.value?.expenditureApplicationId)) {
    expenditureApplicationObj.value = await doGet(svc, '/expenditure-application/' + obj.value?.expenditureApplicationId, {}, false)
  }
  expenditureKpiObj.value = await doGet(svc, '/expenditure-kpi/' + obj.value?.expenditureKpiId, {}, false)
  // files.value = await doGet(svc, '/expenditure-reimbursement-item-file/listByField', {field: 'expenditureReimbursementId', values: id}, false)
}

function fileOnList(arr) {
  arr.forEach(item => {
    arrFiles.value.forEach(file => {
      if (item.id === file?.expenditureFeetypeFileId) {
        item.files.push(file)
      }
    })
  })
}
function downloadFile(row) {
  doGetDownload(svc, '/customAttachment/download/' + row.attachmentId, {})
}

// 下载
function downloadBtn(row) {
  doGetDownload(svc, '/customAttachment/download/' + row.attachmentId, {})
}
// 文件预览
function handlePreview(file) {
  attachmentVisible.value = true
  setTimeout(() => {
    previewAttachmentId.value = file.attachmentId
  },100)
}
function closeBtn() {
  attachmentVisible.value = false
}
</script>

<style scoped>
.table-form, .table-form-1 {
  border-collapse: collapse;
  text-align: center;
}
.report-form-content-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.file-list-btn {
  display: flex;
  /* display: flex; */
  align-items: center;
  justify-content: space-between
}
.report-form-list-content .el-form-item__label {
  width: 13.75rem !important;
}
.el-form-item__label {
  width: 13.75rem !important;
}
.report-form-list-content {
  display: flex;
  flex-wrap: wrap;
}

.form-label {
  display: inline-flex;
  justify-content: flex-end;
  align-items: flex-start;
  flex: 0 0 auto;
  /* font-size: var(--el-form-label-font-size); */
  font-size: 1rem;
  /* color: var(--el-text-color-regular); */
  color: #337ecc;
  height: 2rem;
  line-height: 2rem;
  padding: 0 .75rem 0 0;
  box-sizing: border-box;
  width: 12.5rem;
  font-weight: bold;
}
.update-log {
  width: 100%;
  margin-top: 0;
  margin-bottom: 1.875rem;
}
.select-list {
  width: 100%;
  margin: 1.875rem 0;
  display: flex;
  align-items: center;
  /* justify-content: space-between; */
}
.select-list .el-radio-group {
  margin-right: 1.875rem;
}
.select-list .el-button {
  margin-left: 1.875rem;
}
.add-indexs {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.upload-demo {
  margin-right: 1.25rem;
}
.file-list {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: .625rem 0;
}
.file-list-btns {
  display: flex;
  align-items: center;
}
.file-list-btn-span {
  color: #F56C6C;
  font-size: .75rem;
}
.data-item {
  width: 33%;
  display: flex;
  align-items: center;
  overflow: hidden;
  margin: .9375rem 0;
  font-size: 1rem;
  border-bottom: .0625rem solid #eee;
}
.form-label-div {
  display: inline-flex;
  justify-content: flex-end;
  align-items: flex-start;
  flex: 0 0 auto;
  /* font-size: var(--el-form-label-font-size); */
  font-size: 1rem;
  /* color: var(--el-text-color-regular); */
  color: #337ecc;
  height: 2rem;
  line-height: 2rem;
  padding: 0 .75rem 0 0;
  box-sizing: border-box;
  font-weight: bold;
  }
td,th {
  padding: 1.25rem 0;
}
.data-item label {
  width: 17.5rem;
  text-align: right;
}
.data-item span {
  padding-left: .9375rem;
  display: inline-block;
  width: 31.25rem;
}
.data-item-1 {
  width: 100%;
  align-items:flex-start
}
.data-item-1 label {
  width: 8.375rem !important;
  text-align: right;
}
.data-item-1 span {
  /* padding-left: .9375rem; */
  display: inline-block;
  width: 62.5rem;
}
.demo-tabs {
  width: 64rem !important;
}
.Upload-div {
  display: flex;
  justify-content: center;
}
.files-url {
  list-style-type: none;
  margin: 0;
  padding: 0;
}
.files-url li {
  list-style-type: none;
  margin: .3125rem;
  padding: 0;
  border: .0625rem solid #1ab394;
  background-color: #eaffea;
}
.files-url li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .3125rem .625rem;
}
.files-url li span {
  padding: 0 .3125rem;
  font-size: .75rem;
  font-weight: bold;
}
.file-name {
  color: #202121;
}
.file-kb {
  color: #909399
}
.file-time {
  color: #3e791b;
}
.content-de {
  margin-left: 1.25rem;
}
.upload-demo {
  width: 43.75rem;
}
.file-up {
  padding-left: 1.25rem;
}
.bgcolorgray {
  background-color: #fafafa;
}
</style>
